<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./js/axios.min.js"></script>
</head>
<script>

    function jsonTest()
    {

        var user={userName:'zhangsan',password:123456}

        axios(
            {
                url:'/json-demo/JSONServlet',
                method:'POST',
                data: user
            }
        ).then(function (resp){

            console.log(resp.data)
        })

    }


</script>
<body>

<button onclick="jsonTest()">测试JSON</button>
</body>
</html>